<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/commons/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
  <head>
  <title>wxQrcord列表</title>
  </head>
  <body>
 	<a class="btn-link pull-right"  href="${ctx}/wx3p/manage/${appid}/qrCord/form">添加</a>
 	<table class="table table-striped table-bordered table-hover" id="wxQrcordList">
 	<thead><tr>
		<td>场景</td>
		<td>二维码参数</td>
		<td>有效时间</td>
		<td>二维码地址</td>
		<td>创建时间</td>
		<td>创建人</td>
		<td>二维码类型</td>
 		<td>操作</td>
 	</tr>
 	</thead>
 	</table>
 	<script type="text/javascript" src="${ctx}/static/js/DataTables/js/jquery.dataTables.js"></script>
 	<script type="text/javascript" src="${ctx}/static/js/DataTables/js/jquery.dataTables_bootstrap.js"></script>
 	<script type="text/javascript" src="${ctx}/static/js/DataTables/js/dataTables.defaults.js"></script>
 	<link href="${ctx}/static/js/DataTables/css/dataTables.bootstrap.css" type="text/css" rel="stylesheet" />
 	<script type="text/javascript">
 		var table=null;
		$(function(){
			table=$("#wxQrcordList").DataTable({
			      "sAjaxSource": "${ctx}/wx3p/manage/${appid}/qrCord/pageList",
			      "aoColumns": [
					  	{ "mData": "sceneName","sDefaultContent" : ""},
					  	{ "mData": "param","sDefaultContent" : ""},
					 	{ "mData": "expireseconds","sDefaultContent" : ""},
					 	{ "mData": "imgurl","sDefaultContent" : ""},
					 	{ "mData": "createTime","sDefaultContent" : ""},
					 	{ "mData": "createUserId","sDefaultContent" : ""},
					 	{ "mData": "actionName","sDefaultContent" : ""},
						{ "mData": "id",
							"mRender":function(data){
							var opt='<a class="btn btn-small" onclick="del(\'' + data + '\')">删除</a>';
								return opt;
						   }
						}
			      ]
			    });
		});
    	function del(id){
      		layer.confirm('确定删除?', function(){
      			$.post("${ctx}/wx3p/manage/${appid}/qrCord/del",{id:id},function(d){
      				table.page(table.page()).draw(false);
      				layer.msg(d.msg);
    	  			},"json");
      			});
      	  	}
 	</script>
  </body>
</html>
